﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NNImage
{
    public partial class Podglad : Form
    {
        public Podglad(Bitmap bitmapa, string nazwa)
        {
            InitializeComponent();
            this.Text = nazwa;
            if ((bitmapa.Size.Height < SystemInformation.PrimaryMonitorSize.Height) && (bitmapa.Size.Width < SystemInformation.PrimaryMonitorSize.Width))
            {
                this.Width = bitmapa.Width + 32;
                this.Height = bitmapa.Height + 58;
            }
            else
                this.Size = SystemInformation.WorkingArea.Size;
            pictureBoxObraz.Size = bitmapa.Size;
            pictureBoxObraz.Image = bitmapa;
        }

        private void Podglad_Resize(object sender, EventArgs e)
        {
            panelObraz.Width = this.Size.Width - 32;
            panelObraz.Height = this.Size.Height - 58;
        }
    }

}
